The present invention relates generally to method and system of communicating signals. More particularly, the present invention relates to method and system of communicating signal from one circuit domain to another clock domain using Gray code encoding.
Electrical signals representing useful information are often communication from one circuit domain to another circuit domain. For example, a set of electrical signals representing an address within a storage device is transmitted from a first circuit domain to a second circuit domain. For convenience, each electrical signal is referred to as a bit, and a set of bits is also referred to as a “data word” or “word.” For some applications, the data word can be “wide.” That is, the data word is a set of many bits, or electrical signals. For example, a data word having eight bits (eight bits wide) can be used, for example, to address up to 256 unique locations within a storage medium.
In practice, an incrementing sequence of data words is communication from the first circuit domain to the second circuit domain in quick succession, often thousands or millions of words per second. The data words are typically encoded in typical decimal based binary data format.
To improve reliability and speed of the communication of the data words from the first circuit domain to the second circuit domain, each data word (in decimal binary format) is converted to Gray code format before it is transmitted from the first circuit domain. At the second circuit domain, the received data word (in Gray code binary format) is converted back to decimal binary data format before it is further processed or used. For convenience, a data word in decimal base binary data format is refereed to as a “binary word,” and data word in Gray code binary format is refereed to as a “Gray code word.” Further, a sequence of binary words is referred to as “decimal-binary sequence” and a sequence of Gray code words is referred to as “Gray code sequence.” A decimal-binary sequence has a finite number B of binary words (set of signals). Number B is also referred to as the number of “states” of the decimal-binary sequence. A corresponding Gray code sequence has the same number of states.
In a complete sequence of a decimal-binary sequence having binary words with width N, the value of B (the number of states of the decimal-binary sequence) is 2N. For example, TABLE 1 below lists a complete decimal-binary sequence of data words having 4 bits of width. That is, for the sample decimal-binary sequence, N is 4, and, thus, B is 24 which is 16. The sample decimal-binary sequence has 16 states as indicated by State Index 0 to 15.
TABLE 1Decimal-CorrespondingBinaryGray codeState Indexsequencesequence000000000100010001200100011300110010401000110501010111601100101701110100810001100910011101101010111111101111101211001010131101101114111010011511111000
Note that, for the sample decimal-binary sequence of TABLE 1, the corresponding Gray code sequence has a useful property that makes the Gray code value in many applications. The useful property is that, in the Gray code sequence, any two successive values differ in only one digit. This property is used in many communication applications to increase examine reliability of transmitted data.
There are two basic approaches for converting a decimal-binary sequence to a corresponding Gray code sequence. In the first approach, a conversion look-up table is used to convert each binary word of the decimal-binary sequence to its corresponding Gray code word. To implement this technique, the conversion look-up table is manually populated. That is, the conversion look-up table is created having an entry for each possible binary word and its corresponding Gray code word. Each entry of the conversion look-up table is manually coded and entered. For a large decimal-binary sequence (requiring a table having hundreds, thousands, or even more entries), this approach is difficult to perform, time consuming, requires high labor costs, and is error prone.
In the second approach, a known conversion algorithm is used to convert each binary word (in binary data format) to its corresponding binary word in Gray code format. Typically the conversion is performed on the fly; however, the conversion can be performed to populate a conversion look-up table. Several techniques for converting a decimal-binary sequence to Gray code sequence are known in the art. Once known technique for converting a decimal-binary sequence to Gray code sequence using software is reproduced below as a computer program.
The known conversion techniques are applicable only for decimal-binary sequence s having the number of states N is a power of two. That is, the known conversion techniques are applicable only for a decimal-binary sequence with N states where N is equal to 2n where n is an integer. For example, N can be 2, 4, 8, 16, 32, etc. Further, the known conversion techniques also require that each successive binary word of the decimal-binary sequence be either incrementing or decrementing by one (1) from the previous binary word within the decimal-binary sequence. That is, the binary word at position i within the sequence is either greater than or less than the binary word at position i−1 by only one.
For a decimal-binary sequence having a number of states N that is not a power of two, known algorithms are not applicable, and a conversion look-up table needs to be manually coded. However, as already discussed, manual population of conversion look-up tables are often difficult to perform, time consuming, requires high labor costs, and is error prone.
Accordingly, there remains a need for improved method and system for converting decimal-binary sequence of signals to Gray code sequence of signals.